{% extends "default/base.html" %}
{% load i18n %}
{% load sell_tags %}

{% block content %}
<ul class="breadcrumb">
 <li><a href="{% url market_home %}">{% trans "Home" %}</a><span class="divider">/</span>
 <li class="active">{% trans "Items For Sale" %}</li>
</ul>

{% block filter_content %}
{% endblock %}

{% block main_content %}
<div class="span12 offset2">
	<h2>{{ total }} Items For Sale Found</h2>
	<p>Listing {{ items.object_list.count }} item{{ items.object_list.count|pluralize }}</p>
<div class="row">	
	{% if items.object_list.count %}
	{% for item in items.object_list %}

  <div id="{{ item.product_ptr_id }}" class="modal hide fade">
            <div class="modal-header">
              <a href="#" class="close">&times;</a>
              <h3>{{ item.title }}</h3>
            </div>
            <div class="modal-body">
		{% if item.image %}
              <p><img src="{{item.child.image.image.url_100x100}}" alt="{{ item.description|striptags|safe }}" ></p>
             <p>{{ item.description|striptags|safe }}</p>
            	{% else %}
		 <p> <img src="{{ STATIC_URL }}img/no-photo-medium.jpg" alt="{{ item.description|striptags|safe }}" ></p>
             	 <p>{{ item.description|striptags|safe }}</p>
            	{% endif %}
		  </div>
            <div class="modal-footer">
              <a href="{% url market_buy_product_redirect item.product_ptr_id %}" target="_blank" class="btn primary">Go To Product Page</a>
              <a href="#" class="btn secondary">Go Back To Marketplace</a>
            </div>
          </div>

		<div class="item_box">
			<a data-controls-modal="{{ item.product_ptr_id }}" data-backdrop="true" data-keyboard="true">		{% if item.image %}
			<img class="item" src="{{ item.child.image.image.url_100x100 }}" title="{{ item.description|striptags }}"/>
			{% else %}
			<img class="item" src="{{ STATIC_URL }}img/no-photo-medium.jpg" title="{{ item.description|striptags }}"/>
			{% endif %}
			<div class="title">{{ item.title|truncatewords:5 }}</div>
			<div class="dealer">{{ item.category.name }}</div>
			<div class="price">{{ item.price|money_format:item.shop }}</div>
			</a>
		</div>
	{% endfor %}
</div>
<div class="row">
	
	<div class="pagination">
	{% with items as objects %}
		{% include 'paginator.html'%}
	{% endwith %}
	</div>
			
	{% else %}
<h3>	{% trans "No items for sale found" %}</h3>
	{% endif %}
</div>	
</div>
{% endblock %}

{% endblock %}
